<div class="form-group upgrade_level">
    <label class="col-sm-2 control-label" >升级等级：</label>
    <div class="col-sm-10">
        {volist name="UsersRole" id="role" key='index'}
        {if condition="$role.role_id != 2"}
        <label class="radio-inline">
            <input type="radio" name="upgrade_level" value="{$role.role_id}" {if $row.upgrade_level == $role.role_id }checked{/if} >{$role.role_name}
        </label>
        {/if}
        {/volist}
    </div>
</div>
<div class="line line-dashed line-lg pull-in" ></div>
<div class="form-group">
    <label class="col-sm-2 control-label" >商品图片：</label>
    <div class="col-sm-10">
        <div class="js_upload_container">
            <div class="js_file_upload ">
                <button type="button" class="btn btn-default js_new_upload" data-submitname="GoodsImages" data-count="10" data-uploadpath="{:url('mainAdmin/attachment/goodsUpload')}" data-delpath="{:url('mainAdmin/attachment/removeImg')}" data-data="{ 'gid':'{$is_copy ? 0 : $row.goods_id|intval}' }" style="position: relative; z-index: 1;">商品图片</button>
                <span class="maroon">*</span>
                <span class="help-inline">(建议尺寸：640*640或800*800)默认显示第1张图片，最多10张 (<small>可拖拽图片调整显示顺序 </small>)</span>
            </div>
            <div class="uploadify-queue js_file_upload_queue">
            </div>
            <ul class="ipost-list ui-sortable js_fileList" data-required="true">
                {volist name="goods_imgs" id="gg"  }
                <li class="imgbox" data-post-id="{$gg.img_id}" data-path="{$gg.goods_img}">
                    <a class="item_new_close item_close" href="javascript:void(0)" data-delpath="{:url('mainAdmin/attachment/removeImg')}"  title="删除" data-path="{$gg.goods_img}" data-post-id="{$gg.img_id}"></a>
                    <input value="{$gg.img_id}" name="GoodsImages[id][]" type="hidden">
                    <input value="{$gg.goods_img}" name="GoodsImages[path][]" type="hidden">
                    <span class="item_box"><img src="{$gg.goods_thumb}"></span>
                </li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label" >商品视频：</label>
    <div class="col-sm-10">
        <div class="js_upload_container">
            <input type="text" name="video_url" class="input-max hide" value="{$row.video_url}"/>
            <button type="button" class="btn btn-default js_file_upload" data-file_type="video" data-uploadpath="{:url('mainAdmin/attachment/uploadVideo')}" style="position: relative; z-index: 1;">点击上传视频
            </button>
            <span style="color:red;margin-top:0.5rem">只支持上传mp4</span>
            {if condition="$row.video_url"}
            <a href="{$row.video_url}" target="_blank">查看视频</a>
            {/if}
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label" >视频显示位置：</label>
    <div class="col-sm-10">
        <label class="radio-inline">
            <input type="radio" name="video_position" value="0" {$row.video_position|tplckval='=0','checked',true} >不显示
        </label>
        <label class="radio-inline">
            <input type="radio" name="video_position" value="1" {$row.video_position|tplckval='=1','checked'} >商品轮播图（首位）
        </label>
        <label class="radio-inline">
            <input type="radio" name="video_position" value="2" {$row.video_position|tplckval='=2','checked'}  /> 商品详情
        </label>
    </div>
</div>
<div class="line line-dashed line-lg pull-in" ></div>
<div  class="form-group" >
    <label class="col-sm-2 control-label">商品规格：</label>
    <div class="col-sm-10">
        {if condition="$row.goods_id > 0" }
        <div ><span class="help-inline"> {$row.is_spec==0?'统一规格':'多规格'}</span></div>
        {/if}
        <div class="f-l {$row['goods_id'] < 1?'':'hide'}">
            <label class="radio-inline">
                <input type="radio" name="is_spec" value="0" data-toggle="specification-enable" data-enable="false"  {$row.is_spec|tplckval='=0','checked',true}  />统一规格
            </label>
            <label class="radio-inline">
                <input type="radio" name="is_spec" value="1"  data-toggle="specification-enable" data-enable="true" {$row.is_spec|tplckval='=1','checked'}/>
                多规格</label>
            <span class=" help-inline">*添加商品后不能修改规格</span>
        </div>

        <div class="m-t-md col-sm-8 specificationstable hd">

            选择商品模型
            {if condition="$row.goods_id < 1" }
            <select name="sku_model" id="skuModelId" {$is_supplyer==true?'disabled':''} data-toggle="changeSkuModelId">
                {$skuModelOpt|raw}
            </select>
            <span  style="color:#f30;">* 修改模型，将会删除旧有的sku记录</span>
            {else/}
            <select disabled id="skuModelId" {$is_supplyer==true?'disabled':''} data-toggle="changeSkuModelId">
                {$skuModelOpt|raw}
            </select>
            <input type="hidden" name="sku_model" value="{$row.sku_model|intval}">
            {/if}

        </div>




        <div class="clearfix"></div>
        <div data-toggle="specifications" class="hd {$is_supplyer?'hide':''}"><i class="fa fa-spinner fa-spin"></i></div>

    </div>
</div>
<div class="line line-dashed line-lg pull-in specificationstable hd" style="width:98%;"></div>

<div class="form-group specificationstable hd">
    <label class="col-sm-2 control-label">价格&库存：</label>
    <div class="table-responsive tab-content p-l" style="width:81%;" data-toggle="specificationstable">
        <span class="help-inline p-t ">请选择规格</span>
    </div>
</div>

<div class="nospecifications {$row['is_spec']==1?'hd':''}">
    {if condition="$is_supplyer == false" }
    <div class="form-group">
        <label class="col-sm-2 control-label">货号：</label>
        <div class="col-sm-4 ">
            <input type="text" class="input-medium" name="goods_sn" value="{$row.goods_sn}" data-rule-maxlength="20" data-rule-required="true" data-msg-required="商品货号不能为空">
            <span  style="color:#f30;"> *</span>
        </div>
        <div class="help-inline"></div>
    </div>

    <!-- <div class="form-group">
        <label class="col-sm-2 control-label">条形码：</label>
        <div class="col-sm-2 ">
            <input type="text" class="input-medium" name="bar_code" value="{$row.bar_code}" data-rule-maxlength="20" >
        </div>
        <div class="help-inline"></div>
    </div> -->


    <div class="form-group">
        <label class="col-sm-2 control-label">重量：</label>
        <div class="col-sm-2">
            <div class="input-group" style="width: 180px;">
                <input type="text" class="input-medium" name="goods_weight" data-rule-min="0"  data-rule-number="true"  value="{$row.goods_weight}">
                <span class="input-group-addon">g</span>
            </div>
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">销售价：</label>
        <div class="col-sm-4">
            <input type="text" class="input-mini" name="shop_price" min="0" data-rule-ismoney="true" data-rule-required="true" data-msg-required="销售价不能为空" value="{$row.shop_price}">
            元<span  style="color:#f30;"> *</span>
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">市场价：</label>
        <div class="col-sm-4">
            <input type="text" class="input-mini" name="market_price" data-rule-ismoney="true" value="{$row.market_price}">元
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">库存：</label>
        <div class="col-sm-8">
            {$row['goods_id']>0?'当前库存：'.$row['goods_number'].' + ':''}<input type="text" class="input-mini" name="goods_number" data-rule-number="true" data-rule-required="true" data-msg-required="库存不能为空" value="{$row['goods_id']>0?'0':''}">
            <span class="red">*</span>
        </div>
    </div>
    {else}
    <div class="form-group">
        <label class="col-sm-2 control-label">货号：</label>
        <div class="col-sm-4 ">
            <div class="help-inline">{$row['goods_sn']}</div>
        </div>
        <div class="help-inline"></div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">条形码：</label>
        <div class="col-sm-2 ">
            <div class="help-inline">{$row['bar_code']}</div>
        </div>
        <div class="help-inline"></div>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">重量：</label>
        <div class="col-sm-2">
            <div class="input-group" style="width:50px;">
                <input type="text" class="input-mini" name="goods_weight" data-rule-min="0"  data-rule-number="true"  value="{$row.goods_weight}">
                <span class="input-group-addon">g</span>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">市场价：</label>
        <div class="col-sm-8">
            <div class="help-inline">{$row['market_price']|priceFormat=true}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">库存：</label>
        <div class="col-sm-8">
            <div class="help-inline"> {$row['goods_number']}</div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">供货价：</label>
        <div class="col-sm-4">
            <div class="help-inline red"><b>{$row.settle_price|priceFormat=true}</b></div>
            <input type="hidden" name="settle_price" value="{$row.settle_price}">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">销售价：</label>
        <div class="col-sm-4">
            <input type="text" class="input-mini" name="shop_price" min="0" data-rule-ismoney="true" data-rule-required="true" data-msg-required="销售价不能为空" value="{$row.shop_price}">
            元<span  style="color:#f30;"> *</span>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">促销价：</label>
        <div class="col-sm-8">
            <input type="text" class="input-mini" data-rule-ismoney="true" name="promote_price" value="{$row.promote_price}" >元
            <span class="help-inline">促销期间以此价格进行销售</span>
        </div>
    </div>
    {/if}
</div>
{if $row.goods_type ==4}
<div class="form-group">
    <label class="col-sm-2 control-label">赠送冻积分比例：</label>
    <div class="col-sm-8">
        <input type="text" class="input-mini" data-rule-ismoney="true" name="send_bl" value="{$row.send_bl}" >%
    </div>
</div>
{/if}
<div class="form-group">
    <label class="col-sm-2 control-label">排序：</label>
    <div class="col-sm-8">
        <input type="text" class="input-mini" name="sort_order"  data-rule-min="0"  data-rule-number="true" value="{$row['sort_order']}">
        <span class="help-inline">数值越大越靠前</span>
    </div>
</div>

<div class="">
    <div class="form-group">
        <label class="col-sm-2 control-label">折扣优惠：</label>
        <div class="col-sm-10">
            {volist name="UsersRole" id="role" key='index'}
            <span>{$role.name}:</span>
            &nbsp;
            <input type="text" name="vip_discount[{$role.role_id}][num]" class="input-ssmall" min="0" value="{$vip_discount[$role.role_id][num]}">
            <span>折</span>
            &nbsp; &nbsp; &nbsp;
            {/volist}
        </div>
    </div>
</div>
